<template>
  <div id="home">
  {{ $store.state.str }}
  {{str}}
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
  name: 'Home',
  data() {
    return {
      citys: {}
    }
  },
  computed: {
    ...mapState([
      'str'
    ])
  },
  created() {
    // this.$store.commit('changeStr', '刘永清我一看就知道你不是人')
    this.changeStr('刘永清我一看就知道你不是人')
  },

  methods: {
    ...mapMutations([
      'changeStr'
    ])
  }
}
</script>
<style lang="scss" scoped>
#home{
  background-color: #fff;
}
  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    // justify-content: space-between;
  }
  li{
    flex-basis: 22%;
    font-size: 12px;
    border: 1px solid #333;
    text-align: center;
    line-height: 30px;
    border-radius: 4px;
    margin: 10px 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
</style>
